package com.globalresources.business.inface;

import java.util.List;

import com.globalresources.commons.vo.UserAndDocumentWrapper;
import com.globalresources.po.Document;
import com.globalresources.ui.struts.action.document.vo.PatientDocument;

/**
 * @author aaron.lu(luzhiyuan) E-mail:atyuan.lu@gmail.com
 * @since 创建时间：Jul 19, 2009 10:33:23 AM
 * @version 0.0.2
 * @author chenheng 
 * 2009-09-23 21:12
 */
public interface IDocumentService {
	
	/**
	 * get documents
	*@author aaron.lu(luzhiyuan)
	*@param userid <cod>Integer</code>
	*@param isSign <code>Byte</code>
	*@param isView <code>Byte</code>
	*@return
	 */
	public List<Document> getDocuments(Integer userid, Byte isSign, Byte isView);
	
	
	/**
	 * get documents by Page Number
	*@author songduanlei@gmail.com
	*@param userid <code>Integer</code>
	*@param isSign <code>Byte</code>
	*@param isView <code>Byte</code>
	*@param pageSize<code>int</code>
	*@return
	 */
	public List<Document> getDocumentsByPager(Integer userid, Byte isSign, Byte isView,int currentPage,int pageSize);
	
	/**
	 * count documents
	*@author aaron.lu(luzhiyuan)
	*@param userid
	*@param isSign
	*@param isView
	*@return
	 */
	public int countDocuments(Integer userid, Byte isSign, Byte isView);
	
	/**
	 * load a document
	*@author aaron.lu(luzhiyuan)
	*@param id
	*@return
	 */
	public Document getDocument(Integer id);
	
	/**
	 * save a document
	*@author aaron.lu(luzhiyuan)
	*@param document
	 */
	public void saveDocument(Document document);
	
	
	/**
	 * update a documnet
	*@author aaron.lu(luzhiyuan)
	*@param document
	 */
	public void updateDocument(Document document);
	
	/**
	 * <p>查询所有医院里的文档
	*@author aaron.lu(luzhiyuan)
	*@param hospital_id
	*@return
	 */
	public List<Document> getAllDocumentInHospital(Integer hospital_id);
	
	/**
	 * <p>查询文档统计报表
	*@author aaron.lu(luzhiyuan)
	*@param hospital_id
	*@param order_flag
	*@return
	 */
	public List<UserAndDocumentWrapper> getDocumentSum(Integer hospital_id, String order_flag);
	
	
	/**
	 * load hospital's documents 
	*@author liming.yu(yulm88@gmail.com)
	*@param hospitalid 医院编号
	*@param isSign  是否签名
	*@param isView   
	*@return
	 */
	public List<Document> getHospitalDocuments(Integer hospitalid, 
			Byte isSign, Byte isView);
	
	/**
	 * count hospital's documents 
	*@author liming.yu(yulm88@gmail.com)
	*@param hospitalid 医院编号
	*@param isSign  是否签名
	*@param isView   
	*@return
	 */
	public int countHospitalDocuments(Integer hospitalid, Byte isSign, Byte isView);
	
	
	/**
	 * 返回页码
	 * @param List<Document> documents
	 * @param Document document
	 * */
	
	public int getPageNumber(List<Document> documents,Document document);
	
	/**
	 * 返回hashmap列表的 文档信息
	 * 
	 * */
	public List<Document> getDocumentEditList(String[] documentCheckBox);
	
	/**
	 * 程序签名
	 * 返回boolean
	 * */
	public boolean doSignDocument(String fileName,String signReason,String signLocation)throws Exception;
	
	/**
	 * @version 0.0.2
	 * @author chenheng
	 * 根据病人的病历号查询病人的所有文档
	 * @param caseNumber
	 * @param currentPage
	 * @param pageSize
	 * @return
	 */
	public List<Document> getDocumentByPatient(String caseNumber,int currentPage,int pageSize);
	/**
	 * @version 0.0.2
	 * @author chenheng
	 * 根据病人的病历号查询病人的所有文档数
	 * @param caseNumber
	 * @return
	 */
	public int getDocumentNumByPatient(String caseNumber);
	/**
	 * @version 0.0.2
	 * @author chenheng
	 * 根据病人的病历号查询病人的已签名（未签名）文档数
	 * @param caseNumber
	 * @param isSign
	 * @return
	 */
	public int getSignDocumentNumByPatient(String caseNumber,byte isSign);
	/**
	 * @version 0.0.2
	 * @author chenheng
	 * 根据病人的病历号查询病人的已签名（未签名）文档
	 * @param caseNumber
	 * @param currentPage
	 * @param pageSize
	 * @param isSign
	 * @return
	 */
	public List<Document> getSignDocumentByPatient(String caseNumber,byte isSign,int currentPage,int pageSize);
	/**
	 * @version 0.0.2
	 * @author chenheng
	 * 查询所有的病人
	 * @param currentPage
	 * @param pageSize
	 * @return
	 */
	public List<PatientDocument> getPatient(final int currentPage ,final int pageSize);
	/**
	 * @version 0.0.2
	 * @author chenheng
	 * 查询病人人数
	 * @return
	 */
	public int getPatientNum();
	/**
	 * @version 0.0.2
	 * @author chenheng
	 * 根据列出的条件搜索文档
	 * @param document
	 * @param currentPage
	 * @param pageSize
	 * @return
	 */
	public List<PatientDocument> getDocumentByCondition(PatientDocument patientDocument,int currentPage,int pageSize);
	/**
	 * @version 0.0.2
	 * @author chenheng
	 * 根据列出的条件搜索文档数
	 * @param document
	 * @return
	 */
	public int getDocumentNumByCondition(PatientDocument patientDocument);
}
